package com.kaoshi.agency.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kaoshi.agency.domain.Qianyue;
import com.kaoshi.agency.service.QianyueService;
import com.kaoshi.agency.mapper.QianyueMapper;
import com.kaoshi.common.config.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
* @author 杨家林
* @description 针对表【qianyue】的数据库操作Service实现
* @createDate 2024-10-29 09:23:40
*/
@Service
public class QianyueServiceImpl extends ServiceImpl<QianyueMapper, Qianyue>
    implements QianyueService{

    @Autowired
    private QianyueMapper qianyueMapper;
    @Override
    public Page findAll(Integer pageNum, Integer pageSize, Qianyue qianyue) {
        Page<Qianyue> page = new Page(pageNum,pageSize);
        List<Qianyue> list = qianyueMapper.findAll(page,qianyue);
        page.setRecords(list);
        return page;
    }

    @Override
    public Page findAllJl(Integer pageNum, Integer pageSize, Qianyue qianyue) {
        Page<Qianyue> page = new Page(pageNum,pageSize);
        List<Qianyue> list = qianyueMapper.findAllJl(page,qianyue);
        page.setRecords(list);
        return page;
    }

    @Override
    public Qianyue findById(Integer id) {
        return qianyueMapper.findById(id);
    }

    @Override
    public List<Qianyue> findAll2() {
      return  qianyueMapper.findAll2();
    }


    @Override
    public List<Qianyue> getByBh(Integer bh) {
        QueryWrapper<Qianyue> qianyueQueryWrapper = new QueryWrapper<>();
        qianyueQueryWrapper.eq("bianhao",bh);
        return baseMapper.selectList(qianyueQueryWrapper);
    }
}




